package main;

import main.queue.CircularQueue;

import java.util.*;

/**
 * @author: kejl
 * @create: 2020-07-06 22:43
 */
public class Test {

    public static void main(String[] args) {


        int res = 'a' - 'b';
        System.out.println(res);

        TreeMap<Integer,Integer> map = new TreeMap<Integer,Integer>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return 0;
            }
        });

        List<Integer> resList= new ArrayList<Integer>();



        Set<Integer> rowset = new HashSet<Integer>();
        int[][] intarray = new int[][]{{1,1,2,2},{3,3,3,3}};

        int[] re = new int[]{1,2,3,4};
        Arrays.sort(re);

        Arrays.sort(intarray,new Comparator<int[]>(){
                @Override
                public int compare(int[] o1, int[] o2) {
                    return 0;
                }
        });

        TrieNode trie = new TrieNode();
        List<String> roots = new ArrayList<String>();
        roots.add("qwe");
        roots.add("ert");
        roots.add("fff");
        for (String root: roots) {
            TrieNode cur = trie;
            for (char letter: root.toCharArray()) {
                if (cur.children[letter - 'a'] == null)
                    cur.children[letter - 'a'] = new TrieNode();
                cur = cur.children[letter - 'a'];
            }
            cur.word = root;
        }


        TrieNode2 trie2 = new TrieNode2();

        List<Integer> integers = new ArrayList<Integer>();

        integers.add(1);
        integers.add(2);
        integers.add(3);
        integers.add(4);
        integers.add(5);
        integers.add(6);
        TrieNode2 trietemp = new TrieNode2();

        for (int i = 0; i <integers.size(); i++) {
            if(i==0){
                trietemp.value=integers.get(i);
                trie2.child = trietemp;
            }else{
                TrieNode2 trietemp2 = new TrieNode2();
                trietemp2.value = integers.get(i);
                trietemp.child = trietemp2;
                trietemp = trietemp2;

            }
        }


        reverseList(trie2);




        int j = ~37;

        int s = -11%10;
        System.out.println(s);

//        Integer[] re = new Integer[10];
//        for (int i = 0; i <re.length ; i++) {
//            System.out.println(re[i]);
//
//        }
//
//        System.out.println(re);

        CircularQueue circularQueue=    new CircularQueue(10);
        circularQueue.enQueue(1);
        circularQueue.enQueue(2);

        circularQueue.enQueue(3);

        circularQueue.enQueue(4);


        circularQueue.deQueue();
        circularQueue.deQueue();
        int result = circularQueue.Front();
        circularQueue.deQueue();

        circularQueue.enQueue(5);

        circularQueue.isEmpty();
        System.out.println(circularQueue.isEmpty());
        System.out.println(result);
    }

   static class TrieNode {
        TrieNode[] children;
        String word;
        TrieNode() {
            children = new TrieNode[26];
        }
    }


    static class TrieNode2 {
        TrieNode2 child;
        int value;
    }

    @org.junit.jupiter.api.Test
    public void changeTest(){
        Integer num = 1;

        changParam(num);
        Str str = new Str("123","456");
        Str result =  changParam2(str);
      System.out.println(str==result);
    }


    public int changParam(int param){
        if (param==1){
            param=1000;
        }

        return param;
    }

    public Str changParam2(Str str){
        str.setName("111");
        return str;

    }

    public static TrieNode2 reverseList(TrieNode2 head) {

        Character character = 'w';
        character.charValue();
        TrieNode2 prev = null;
        TrieNode2 curr = head;
        while (curr != null) {
            TrieNode2 nextTemp = curr.child;
            curr.child = prev;
            prev = curr;
            curr = nextTemp;
        }
        return prev;
    }






}
